package com.itheima.Test;

import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的手机号码");
        String s = sc.nextLine();

        char[] arr = s.toCharArray();
        int f = 1;
        for (int i = 0; i < arr.length; i++) {
            if (arr.length != 11 || arr[i] < '0' || arr[i] > '9') {
                f = 0;
                System.out.println("注册用户失败");
                break;
            }
        }
        if (f == 1)
            System.out.println(s.substring(arr.length - 4));
    }
}
